package com.yohann.designPattern.composite;

/**
 * <p>
 * 客户端
 * </p>
 *
 * @author Yohann
 * @since 2021/2/7 16:46
 */
public class Client {
    public static void main(String[] args) {
        OrganizationComponent university = new University("清华大学", "五道口职业技术学院");
        OrganizationComponent college1 = new College("计算机学院", "秃头学院");
        OrganizationComponent college2 = new College("信息学院", "信息学院");
        university.add(college1);
        university.add(college2);

        OrganizationComponent department1 = new Department("软件工程", "IT民工");
        OrganizationComponent department2 = new Department("网络工程", "网线管理员");
        OrganizationComponent department3 = new Department("信息工程", "信息工程");
        OrganizationComponent department4 = new Department("通讯工程", "通讯工程");
        college1.add(department1);
        college1.add(department2);
        college2.add(department3);
        college2.add(department4);

        /*
        <====== 清华大学 ======>

        <====== 计算机学院 ======>
        <====== 软件工程 ======>
        <====== 网络工程 ======>

        <====== 信息学院 ======>
        <====== 信息工程 ======>
        <====== 通讯工程 ======>
         */
        university.print();
    }
}